LOCAL_PATH    := $(call my-dir)
SPEEX		  := speex-1.2rc3

include $(CLEAR_VARS)

LOCAL_C_INCLUDES := $(LOCAL_PATH)/include

LOCAL_MODULE    := libspeexdsp
LOCAL_ARM_MODE := arm
LOCAL_MODULE_TAGS := optional
LOCAL_CPP_EXTENSION := .cc
LOCAL_SRC_FILES := \
$(SPEEX)/libspeexdsp/buffer.c \
$(SPEEX)/libspeexdsp/fftwrap.c \
$(SPEEX)/libspeexdsp/filterbank.c \
$(SPEEX)/libspeexdsp/jitter.c \
$(SPEEX)/libspeexdsp/mdf.c \
$(SPEEX)/libspeexdsp/preprocess.c \
$(SPEEX)/libspeexdsp/resample.c \
$(SPEEX)/libspeexdsp/scal.c \
$(SPEEX)/libspeexdsp/smallft.c 

LOCAL_CFLAGS := -O2 -DUSE_KISS_FFT -DEXPORT="" -DHAVE_CONFIG_H #-UHAVE_CONFIG_H

ifeq ($(TARGET_ARCH_ABI),armeabi)
    LOCAL_CFLAGS += -mfpu=vfp -mfloat-abi=softfp
endif

ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
#ifneq (,$(filter $(TARGET_ARCH_ABI),armeabi-v7a arm64-v8a))
    LOCAL_CFLAGS += -mfpu=neon -mfloat-abi=softfp -mvectorize-with-neon-quad -D_USE_NEON 
    LOCAL_LDFLAGS := -Wl,--fix-cortex-a8
endif

ifneq (,$(filter $(TARGET_ARCH),x86 x86_64))
	LOCAL_CFLAGS += -D_USE_SSE -D_USE_SSE2 -DFLOATING_POINT
else
	LOCAL_CFLAGS += -DFIXED_POINT
endif


include $(BUILD_STATIC_LIBRARY)
